const fs = require("fs");
const path = require("path");
const { spawn } = require("child_process");

for (let initialSatelliteId = 0; initialSatelliteId <= 22; initialSatelliteId++) {
  const dataPath = path.join(__dirname, "data.js");
  const child = spawn("node", [dataPath, "0", initialSatelliteId.toString()]);


  child.stdout.on("data", (data) => {
    // console.log(`标准输出: ${data}`);
  });

  child.stderr.on("data", (data) => {
    console.error(`错误输出: ${data}`);
  });

  child.on("close", (code) => {
    console.log(`子进程退出码: ${code}`);
  });
}
